﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Sinbiota.Web.Models.TaxonDetailsModel>" %>
<%@ Import Namespace="Localization" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%: Strings.Taxon %>
    -
    <%: Model.Taxon.Name %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2><%: Strings.Taxonomy %></h2>
        
    <div class="panel" style="padding-bottom:20px">
    <b>Lineage:</b>
    <%: Html.ActionLink("Root","Index") %> ; 
    <% foreach (var ancestor in Model.Ancestors)
       { %>
        <%: Html.ActionLink(ancestor.Name, "Details", new { ancestor.Id }, new { title = ancestor.Rank, Class= "taxon_link" })%> ;
    <% }%>
    <strong><%: Model.Taxon.Name%></strong>
    <div class="right" style="position:relative; top:-5px;"><%: Html.ActionLink(Strings.Search + " " + Strings.Taxonomy, "Index", "Taxonomy", null, new {Class="small blue button radius"}) %></div>
    </div>
    <hr />
        <% var name = Model.Taxon.Rank.Contains("species") ? Model.Taxon.ScientificName() : Model.Taxon.Name; %>
            <h4 class="left"> <%: name %> (<i><%: Model.Taxon.Rank %></i>)</h4>
            <% if (Model.CanAddChildren)
{ %>
            <div class="left" style="margin-left:1em;position:relative; top:+3px;"><%: Html.ActionLink(Strings.AddTaxonChild, "Create", "Taxonomy", new {id=Model.Taxon.Id}, new {Class="tiny nice white button round"}) %></div>
<% } %>
            <div class="clearfix"></div>
            <% if (Model.Taxon.Rank.Contains("species"))
{ %>	
<br />
        <b>Taxon reference</b>: <%: Model.Taxon.TaxonReference.Title %>
<% } %>
            <% Html.RenderPartial("TaxonChildren", Model); %>

            <script type="text/javascript">
                $().ready(function () {
                    $(".taxon_link").tipTip();
                });
            </script>
</asp:Content>
